<!DOCTYPE html>
<html>
<php>$siteConfig = C('siteConfig');</php>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="renderer" content="webkit">
    <title>{$siteConfig.name}管理后台</title>
    <link rel="stylesheet" href="/Public/assets/layui2/css/layui.css">
    <link rel="icon" type="image/png" href="/favicon.ico" />
    <meta name="apple-mobile-web-app-title" content="{$siteConfig.name}管理后台" />
    <link rel="stylesheet" href="/Public/assets/common/css/amazeui.min.css" />
    <link rel="stylesheet" href="/Public/assets/store/css/app.css?v=1.1.28" />
    <link rel="stylesheet" href="/Public/common/css/xiyucode.css?v=1.1" />
    <script src="/Public/jquery.min.js"></script>
    <script src="/Public/assets/layui2/layui.js"></script>
    <!-- <script src="/Public/lang/xy_lang_dict.js"></script> -->
    <!-- <script src="/Public/lang/xy_admin_lang_trans.js"></script> -->
    <script>
        layui.config({
            version: "2.1.1",
            base: '/Public/modules/'
        }).use('admin');
    </script>
    <style>
        .layui-form-label {
            width: 100px;
        }
        
        .select-lang-item {
            display: none;
            background-color: rgb(197, 212, 225);
        }
    </style>
</head>

<body>
    <div class="am-g tpl-g">
        <!-- 头部 -->
        <header class="tpl-header">
            <!-- 右侧内容 -->
            <div class="tpl-header-fluid">
                <!-- 侧边切换 -->
                <div class="am-fl tpl-header-button switch-button">
                    <i class="layui-icon layui-icon-spread-left"></i>
                </div>
                <!-- 刷新页面 -->
                <div class="am-fl tpl-header-button refresh-button">
                    <i class="layui-icon layui-icon-refresh-1"></i>
                </div>
                <!-- 其它功能-->
                <div class="am-fr tpl-header-navbar">
                    <ul>
                        <li class="am-text-sm">
                            <a href="/home/index/index.html">首页</a>
                        </li>
                        <!-- 欢迎语 -->
                        <li class="am-text-sm tpl-header-navbar-welcome">
                            <a href="/admin/config/avatar.html">你好，<span>{$_SESSION['loginUser']['username']}</span> <img src="{$_SESSION['loginUser']['avatar'] | default='/Public/common/img/boy1.png'}" class="header-avatar"></a>
                        </li>
                        <!-- 退出 -->

                        <li class="am-text-sm">
                            <!-- <a href="/user/api/logout.html"><i class="iconfont icon-tuichu"></i><xy:trans dict="transDict" text="退出"/></a> -->
                            <a href="/user/api/logout.html"><i class="iconfont icon-tuichu"></i>退出</a>
                        </li>
                    </ul>
                </div>
            </div>
        </header>

        <php>$menus = C('ADMIN_MENU_CAT_GROUP_ID');</php>
        <php>$menuIndex = $menus[$_SESSION['loginUser']['role']];</php>
        <php>$adminMenu = \Admin\Controller\CatController::getdata_cats($menuIndex);</php>
        <php>$curMenuKey = '/'.strtolower(MODULE_NAME).'/'.strtolower(CONTROLLER_NAME); </php>
        <php>$curFullUrl = '/'.strtolower(MODULE_NAME).'/'.strtolower(CONTROLLER_NAME).'/'.strtolower(ACTION_NAME).'.html'; //当前的URL</php>
        <php>$curMenuIndex = -1;</php>
        <php>$childrenMenu = null;</php>
        <!-- 侧边导航栏 -->
        <div class="left-sidebar dis-flex" style="z-index:200">
            <!-- 一级菜单 -->
            <ul class="sidebar-nav">
                <li class="sidebar-nav-heading">{$siteConfig.name}管理后台</li>
                <volist name="adminMenu" id="vo">
                    <php>
                        if(strpos(strtolower($vo['key']),$curMenuKey) !== false){ $curMenuIndex = $key; $childrenMenu = $vo; }
                    </php>
                    <li class="sidebar-nav-link">
                        <a href="{$vo.key}" <if condition="$curMenuIndex eq $key">class="active"</if>>
                            <if condition="$vo['icon']"><i class="{$vo.icon}"></i></if> {$vo.name}
                        </a>
                    </li>
                </volist>
            </ul>
            <!-- 子级菜单-->
            <if condition="$childrenMenu['children']">
                <ul class="left-sidebar-second">
                    <li class="sidebar-second-title">{$childrenMenu.name}</li>
                    <li class="sidebar-second-item">
                        <volist name="childrenMenu['children']" id="vo">
                            <if condition="!$vo['children']">
                                <!-- 二级菜单-->
                                <php>if(strpos(strtolower($vo['key']),$curFullUrl) !== false){</php>
                                <a href="{$vo.key}" class="active">{$vo.name}</a>
                                <php>}else{</php>
                                <a href="{$vo.key}">{$vo.name}</a>
                                <php>}</php>
                                <else/>
                                <!-- 三级菜单-->
                                <div class="sidebar-third-item">
                                    <a href="javascript:void(0);" class="sidebar-nav-sub-title active">
                                        <i class="iconfont icon-caret"></i>{$vo.name}</a>
                                    <ul class="sidebar-third-nav-sub">
                                        <volist name="vo['children']" id="to">
                                            <php>if(strpos(strtolower($to['key']),$curFullUrl) !== false){</php>
                                            <li><a href="{$to.key}" class="active">{$vo.name}</a></li>
                                            <php>}else{</php>
                                            <li><a href="{$to.key}">{$vo.name}</a></li>
                                            <php>}</php>
                                        </volist>
                                    </ul>
                                </div>

                            </if>
                        </volist>
                    </li>
                </ul>
            </if>

        </div>

        <!-- 内容区域 start -->
        <php>$hasSecond = $childrenMenu['children'] ? false : true;</php>
        <div class="tpl-content-wrapper <if condition='$hasSecond'>no-sidebar-second</if>">
            <div class="row-content am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <block name="main"></block>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 内容区域 end -->
    </div>
</body>
<script>
    layui.config({
        base: '/Public/modules/'
    }).use(['xiyucode']);
</script>

</html>